<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>轮播图</title>

    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
        }
        
        @font-face {
            font-family: 'icomoon';
            src: url('fonts/icomoon.eot?gccjfb');
            src: url('fonts/icomoon.eot?gccjfb#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?gccjfb') format('truetype'), url('fonts/icomoon.woff?gccjfb') format('woff'), url('fonts/icomoon.svg?gccjfb#icomoon') format('svg');
            font-weight: normal;
            font-style: normal;
            font-display: block;
        }
        
        .all {
            width: 600px;
            height: 300px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin: -200px 0 0 -260px;
        }
        
        .all .point {
            width: 90px;
            height: 15px;
            background-color: #fff;
            position: absolute;
            left: 50%;
            margin-left: -80px;
            bottom: 30px;
            line-height: 10px;
            text-align: center;
            border-radius: 8px;
        }
        
        .all .point li {
            float: left;
            width: 10px;
            height: 10px;
            background: black;
            opacity: 0.3;
            border: 1px solid #ccc;
            margin-left: 5px;
            margin-top: 2px;
            cursor: pointer;
            border-radius: 50%;
        }
        
        .all .point li:hover {
            background: #DB192A;
        }
        
        #arr span {
            width: 20px;
            height: 30px;
            line-height: 30px;
            color: white;
            top: 50%;
            margin-top: -15px;
            position: absolute;
            background-color: #000;
            opacity: 0.3;
            cursor: pointer;
            text-align: center;
            font-size: 20px;
        }
        
        #arr #left {
            font-family: 'icomoon';
            border-bottom-right-radius: 15px;
            border-top-right-radius: 15px;
        }
        
        #arr #right {
            font-family: 'icomoon';
            right: 80px;
            border-bottom-left-radius: 15px;
            border-top-left-radius: 15px;
        }
    </style>
</head>

<body>
    <div class="all">
        <img id="img" src="./images/TB01.jpg">
        <ul class="point">
            <li id="one" onclick="One()"></li>
            <li id="two" onclick="Two()"></li>
            <li id="three" onclick="Three()"></li>
            <li id="four" onclick="Four()"></li>
            <li id="five" onclick="Five()"></li>
        </ul>
        <div id="arr">
            <span id="left" onclick="left()"></span>
            <span id="right" onclick="right()"></span>
        </div>
    </div>

    <script>
        var number = 1;

        function lunbo() {
            number = number + 1;
            if (number > 5) {
                number = 1;
            }
            var img = document.getElementById("img");
            img.src = "./images/TB0" + number + ".jpg";
        }
        setInterval(lunbo, 3000);

        function left() {
            number = number - 1;
            if (number < 1) {
                number = 5;
            }
            var img = document.getElementById("img");
            img.src = "./images/TB0" + number + ".jpg";
        }

        function right() {
            lunbo();
        }

        function One() {
            var img = document.getElementById("img");
            img.src = "./images/TB01" + ".jpg";
        }

        function Two() {
            var img = document.getElementById("img");
            img.src = "./images/TB02" + ".jpg";
        }

        function Three() {
            var img = document.getElementById("img");
            img.src = "./images/TB03" + ".jpg";
        }

        function Four() {
            var img = document.getElementById("img");
            img.src = "./images/TB04" + ".jpg";
        }

        function Five() {
            var img = document.getElementById("img");
            img.src = "./images/TB05" + ".jpg";
        }
    </script>
</body>

</html>